import {

} from 'react-native';
import CommonSendFetchAction from '../common/CommonSendFetchAction';
import Constants from '../../common/Constants';

export default class JifenMallSendBuyDuihuanItemAction extends CommonSendFetchAction {
  constructor(props) {
    super(props);

    this.moduleType = Constants.MODULE_TYPE.JIFENMALL;
    this.name = "JifenMallSendBuyDuihuanItemAction";
  }

  _dealFinishSucess(data, response) {
    let detail = "";
    this.caller.setState({
      viewStatus:response.status,
      isUpdateByBuyItem:true,
      statusText:detail,
      data:data,
    })
  }

  _dealFinishFailed(data, response) {
    let detail = "购买失败";
    if(data && data.detail != undefined) {
      detail = data.detail;
    }
    this.caller.setState({
      isUpdateByBuyItem:true,
      viewStatus:response.status,
      statusText:detail + " " + response.status,
    })
  }
}
